package com.bella.api.configuration;

import com.bella.api.utils.ApiResponseCode;

/**
 * @author zsq
 * @create 2020-05-26-10:03
 */
public class BusinessException extends RuntimeException{
    private Integer code;
    private String msg;
    public BusinessException(ApiResponseCode code) {
        super(code.getMessage());
        this.code = code.getCode();
        this.msg = code.getMessage();
    }

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }

    public String getMsg() {
        return this.msg;
    }

    public Integer getCode() {
        return this.code;
    }
}
